Skip to content

Conversation

@paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Mar 20, 2025

Description

Forgot about this when implementing the rules generation.
The button is enabled when the validator is empty (either empty string or empty object). Editor to be editable but doesn't have to be in the edit mode (that would be an extra click for the same action). Button is in loading state when the generation is in progress.

Screenshot 2025-03-20 at 17 39 48

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@paula-stacho paula-stacho requested a review from Anemy March 20, 2025 16:40
@github-actions github-actions bot added the fix label Mar 20, 2025
@paula-stacho paula-stacho added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Mar 20, 2025
@paula-stacho paula-stacho changed the title fix(compass-schema-validation): add generate button to the editor fix(compass-schema-validation): add generate button to the editor COMPASS-9145 Mar 20, 2025
<div className={generateButtonContainerStyles}>
<Button
data-testid="generate-rules-button"
disabled={!isEmpty}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow for folks to click the button if they are on the default template also? I'm thinking they may click Add Rule then want to generate rules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps? Maybe until they make any edits.. It feels weird to me though.. We can check with Julia and Misba

@paula-stacho paula-stacho merged commit d6b51a7 into main Mar 20, 2025
55 checks passed
@paula-stacho paula-stacho deleted the generate-in-editor branch March 20, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature flagged PRs labeled with this label will not be included in the release notes of the next release fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants